import json


new_symbol_str = """
    {   
      "symbol": "YGG-USDT.PERPETUAL",
      "base": "YGG",
      "quote": "USDT",
      "native_symbol": "YGGUSDT.PERP",
      "native_base": "YGG",
      "native_quote": "USDT",
      "price_ticksize": [
        {
          "from": 0,
          "to": 1000000000.0,
          "value": 0.0001
        }
      ],
      "qty_ticksize": [
        {
          "from": 0,
          "to": 1000000000.0,
          "value": 0.1
        }
      ],
      "is_inverse": false,
      "contract_value": 1.0,
      "min_amount": 0,
      "maker_fee": 0,
      "taker_fee": 0,
      "fetched_time": 1691422245426191541
    }
"""

new_symbol = json.loads(new_symbol_str)
print(type(new_symbol))

print(new_symbol["symbol"])
path = "experimental/qiang/product/pi/20230807/Futures.Prex.v1.json"
with open(path, "r+") as f:
  pis = json.load(f)

pis["product_infos"].append(new_symbol) 

with open(path, "w+") as f:
  json.dump(pis, f, indent=2)
